<script setup lang="ts">
defineProps<{
  name: string
  money?: number
}>()

defineEmits<{
  (e: 'changeMoney', money: number): void
}>()
</script>

<template>
  <div>我是子组件</div>
  <div>{{ name }}</div>
  <div>{{ money }}</div>
  <button @click="$emit('changeMoney', 8200)">借钱</button>
</template>

<style scoped>
div {
  width: 100px;
  background-color: aqua;
}
</style>
